package com.demo.action;

import com.demo.common.CreateUUID;
import com.demo.model.Users;
import com.demo.service.UsersService;
import com.demo.service.impl.UsersServiceImpl;

public class myAction {
	//不规范的饿汉模式，（单例模式），线程安全的
	private static UsersService service =new UsersServiceImpl();
	


	public void save() {
		Users user=new Users();
		user.setId(CreateUUID.getUUID());
		user.setLoginname("测试");
		user.setPassword("123");
		user.setUsername("无");
		if(service.tab_users_save(user)) 
			System.out.println("成功加入");
		else
			System.out.println("失败了");
	}
	
	public static void main(String[] args) {
		myAction myaction=new myAction();
		myaction.save();
		
	}

}
